﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;

public partial class UserControl_danh_muc_chi_tiet : System.Web.UI.UserControl
{
    protected string strMoTa = "";
    protected void Page_Load(object sender, EventArgs e)
    {
        string strDanhMuc = clsCommon.fncGetRoute(this.Page, "UserControl");
        var dt = clsDanhMuc.fncGetByTenKoDau(strDanhMuc);
        if (dt == null) return;
        else
        {
            this.Page.Title = dt.Rows[0]["dm_tieude"].ToString();
            this.Page.MetaDescription = dt.Rows[0]["dm_mota"].ToString();
        }
        // Tag meta title + des Facebook
        HtmlMeta tag = new HtmlMeta();
        tag.Attributes.Add("property", "og:title");
        tag.Content = dt.Rows[0]["dm_tieude"].ToString();
        Page.Header.Controls.Add(tag);

        HtmlMeta tag2 = new HtmlMeta();
        tag2.Attributes.Add("property", "og:description");
        strMoTa = dt.Rows[0]["dm_mota"].ToString();
        strMoTa = strMoTa.Replace("&lt;", "<");
        strMoTa = OsPortal.oStringHelper.ClearTagHTML(HttpUtility.HtmlDecode(strMoTa));
        tag2.Content = strMoTa;
        Page.Header.Controls.Add(tag2);
        // END Tag meta title + des Facebook
    }
}